import time
from selenium import webdriver
from selenium.webdriver.common.by import By

# 1 打开浏览器
driver = webdriver.Chrome()

# 2 输入ecshop网址搜索首页
driver.get('https://ecshop.test2.shopex123.com')

# 3 点击免费注册选项
driver.find_element(By.CLASS_NAME,'reg').click()

# 4 获取用户名搜索
username = driver.find_element(By.ID, 'username')
username.send_keys('奶茶三分甜')

# 5 获取邮箱
email = driver.find_element(By.ID, 'email')
email.send_keys('619469654@qq.com')

# 6 输入密码
password = driver.find_element(By.ID, 'password')
password.send_keys('jh198322')

# 7 确认密码
confirm_password = driver.find_element(By.ID, 'confirm_password')
confirm_password.send_keys('jh198322')

# 8 点击同意协议并注册
driver.find_element(By.CLASS_NAME, 'signup_button').click()

# 9 退出浏览器
time.sleep(5)
driver.quit()





